using DataDynamics.ActiveReports;
using DataDynamics.ActiveReports.Export.Xls;
using SM.core;
using SS;
using SS.core;
using SS.dir;
using System;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
namespace TVSBH.func
{
	public class frmExpiryDate : Form
	{
		private Func objFunc = new Func();
		private DataTable objTable = new DataTable();
		private Bill objBill = new Bill();
		private int DayBalancer = 0;
		private string strConnection = "";
		private frmWaitting objW;
		public string userName = "";
		public string fullName = "";
		private IContainer components = null;
		private DataGridView dgvProduct;
		private Button btnClose;
		private GroupBox groupBox1;
		private ComboBox cbbParentGID;
		private System.Windows.Forms.Label label1;
		private Button btnPrint;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.TextBox txtDay;
		private System.Windows.Forms.CheckBox cbbDayDefault;
		private System.Windows.Forms.Label lblWarning;
		private System.Windows.Forms.TextBox txtSearch;
		private System.Windows.Forms.Label label2;
		private Button btnExportToExcel;
		private System.Windows.Forms.Label label24;
		private ComboBox cbbWareHouse;
		private DataGridView dgvRep;
		private DataGridViewTextBoxColumn dg2;
		private DataGridViewTextBoxColumn dg6;
		private System.Windows.Forms.CheckBox ckbProduct;
		private DataGridViewTextBoxColumn Column2;
		private DataGridViewTextBoxColumn Column3;
		private DataGridViewTextBoxColumn Column1;
		private DataGridViewTextBoxColumn Column7;
		private DataGridViewTextBoxColumn Column8;
		private DataGridViewTextBoxColumn Column4;
		private DataGridViewTextBoxColumn Column5;
		private DataGridViewTextBoxColumn Column6;
		private DataGridViewTextBoxColumn Column9;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn9;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn10;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn11;
		private System.Windows.Forms.Label label4;
		public frmExpiryDate()
		{
			this.InitializeComponent();
		}
		private void showWatting()
		{
			this.objW = new frmWaitting();
			this.objW.ShowDialog();
			Thread.Sleep(40);
		}
		private void frmInput_Load(object sender, EventArgs e)
		{
			ThreadStart start = new ThreadStart(this.showWatting);
			Thread thread = new Thread(start);
			thread.Start();
			if (!thread.Join(150))
			{
				Program.strConnectionString = this.objFunc.strConnectionString;
				this.DayBalancer = this.objFunc.getWarningDay();
				this.txtDay.Text = this.DayBalancer.ToString();
				this.objFunc.LoadComboBoxStock("SELECT WareHouse_ID, UPPER(WareHouse_Name) AS Name FROM TabWareHouse ORDER BY WareHouse_Name", this.cbbWareHouse, "WareHouse_ID", "Name");
				this.objFunc.LoadComboBoxGProduct("SELECT GpID, UPPER(GpName) AS GpName FROM TabGproducts ORDER BY [GpName]", this.cbbParentGID, "GpID", "GpName");
				this.dgvProduct.AutoGenerateColumns = false;
			}
			thread.Abort();
		}
		private void btnClose_Click(object sender, EventArgs e)
		{
			base.Close();
		}
		private void frmInput_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Escape)
			{
				base.Close();
			}
		}
		private void cbbParentGID_SelectedIndexChanged(object sender, EventArgs e)
		{
			if (this.cbbParentGID.SelectedValue.ToString() != "0")
			{
				this.getDetailBalancer(string.Concat(new string[]
				{
					"SELECT [Packet],[Pid],[productName],[productNumberIn],[ProductDate],[ProductExpiryDate],[productNumberOut],[productUnit],[MinBalance],[MaxBalance],[productPrice],[ProductMoney],[NationalID],[VAT], DATEDIFF(dy,GETDATE(),[ProductExpiryDate]) AS Subb FROM [TabTotalBalancer] WHERE ([productNumberIn] > [productNumberOut]) AND ([ProductExpiryDate] - getdate() < ",
					this.DayBalancer.ToString(),
					") AND [Pid] IN (SELECT [Pid] FROM [TabProducts] WHERE [GpID] = ",
					this.cbbParentGID.SelectedValue.ToString(),
					") ORDER BY [ProductName]"
				}));
			}
			else
			{
				this.getDetailBalancer("");
			}
		}
		public void getDetailBalancer(string sqlQuery)
		{
			products products = new products();
			try
			{
				DataTable dataTable = new DataTable();
				DataColumn column = new DataColumn("Pid", typeof(string));
				DataColumn column2 = new DataColumn("ProductName", typeof(string));
				DataColumn column3 = new DataColumn("Packet", typeof(string));
				DataColumn column4 = new DataColumn("CreateDate", typeof(DateTime));
				DataColumn column5 = new DataColumn("ProductExpiryDate", typeof(DateTime));
				DataColumn column6 = new DataColumn("subb", typeof(string));
				DataColumn column7 = new DataColumn("ProductNumberOut", typeof(string));
				DataColumn column8 = new DataColumn("ProductNumberBalancer", typeof(string));
				DataColumn column9 = new DataColumn("ProductUnit", typeof(string));
				dataTable.Columns.Add(column);
				dataTable.Columns.Add(column2);
				dataTable.Columns.Add(column3);
				dataTable.Columns.Add(column4);
				dataTable.Columns.Add(column5);
				dataTable.Columns.Add(column6);
				dataTable.Columns.Add(column7);
				dataTable.Columns.Add(column8);
				dataTable.Columns.Add(column9);
				SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
				sqlConnection.Open();
				SqlCommand sqlCommand = sqlConnection.CreateCommand();
				if (sqlQuery == "")
				{
					this.DayBalancer = int.Parse(this.txtDay.Text);
					sqlCommand.CommandText = "SELECT [Packet],[Pid],[productName],[productNumberIn],[ProductDate],[ProductExpiryDate],[productNumberOut],[productUnit],[MinBalance],[MaxBalance],[productPrice],[ProductMoney],[NationalID],[VAT], DATEDIFF(dy,GETDATE(),[ProductExpiryDate]) AS Subb FROM [TabTotalBalancer] WHERE ([productNumberIn] > [productNumberOut]) AND ([ProductExpiryDate] - getdate() < " + this.DayBalancer.ToString() + ") ORDER BY [ProductName]";
				}
				else
				{
					sqlCommand.CommandText = sqlQuery;
				}
				SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
				while (sqlDataReader.Read())
				{
					if (products.getTotalBalancerOfProduct(sqlDataReader["pid"].ToString(), this.cbbWareHouse.SelectedValue.ToString()) > 0f)
					{
						float num = float.Parse(this.numInput(sqlDataReader["Pid"].ToString(), sqlDataReader["Packet"].ToString()));
						float num2 = float.Parse(this.numOutput(sqlDataReader["Pid"].ToString(), sqlDataReader["Packet"].ToString()));
						float num3 = num - num2;
						if (!this.checkProductNameInDataGridView(sqlDataReader["ProductName"].ToString(), sqlDataReader["Packet"].ToString(), dataTable))
						{
							if (!this.checkProductNameInDataGridView(sqlDataReader["ProductName"].ToString(), dataTable))
							{
								dataTable.Rows.Add(new object[]
								{
									sqlDataReader["Pid"].ToString(),
									sqlDataReader["ProductName"].ToString(),
									" " + sqlDataReader["Packet"].ToString(),
									sqlDataReader["ProductDate"].ToString(),
									sqlDataReader["ProductExpiryDate"].ToString().Substring(0, 10),
									sqlDataReader["Subb"].ToString(),
									num2.ToString(),
									num3.ToString(),
									" " + sqlDataReader["ProductUnit"].ToString()
								});
							}
							else
							{
								dataTable.Rows.Add(new object[]
								{
									sqlDataReader["Pid"].ToString(),
									"",
									" " + sqlDataReader["Packet"].ToString(),
									sqlDataReader["ProductDate"].ToString(),
									sqlDataReader["ProductExpiryDate"].ToString().Substring(0, 10),
									sqlDataReader["Subb"].ToString(),
									num2.ToString(),
									num3.ToString(),
									" " + sqlDataReader["ProductUnit"].ToString()
								});
							}
						}
					}
				}
				sqlDataReader.Close();
				sqlConnection.Close();
				sqlConnection.Dispose();
				this.btnPrint.Enabled = true;
				this.objTable = dataTable;
				this.dgvProduct.AutoGenerateColumns = false;
				this.dgvProduct.DataSource = this.objTable;
				if (this.objTable.Rows.Count > 0)
				{
					this.lblWarning.Text = string.Concat(new string[]
					{
						"CÓ ",
						this.dgvProduct.Rows.Count.ToString(),
						" SẢN PHẨM SẼ HẾT HẠN SỬ DỤNG TRONG ",
						this.txtDay.Text.ToUpper(),
						" NGÀY TỚI"
					});
					this.btnPrint.Enabled = true;
					this.btnExportToExcel.Enabled = true;
				}
				else
				{
					this.lblWarning.Text = "";
					this.btnPrint.Enabled = false;
					this.btnExportToExcel.Enabled = false;
				}
			}
			catch
			{
				this.btnPrint.Enabled = false;
				this.btnExportToExcel.Enabled = false;
				this.objTable = null;
				this.dgvProduct.DataSource = this.objTable;
			}
		}
		public void getDetailBalancer_Bakpup_6_1_2011(string sqlQuery)
		{
			products products = new products();
			try
			{
				DataTable dataTable = new DataTable();
				DataColumn column = new DataColumn("Pid", typeof(string));
				DataColumn column2 = new DataColumn("ProductName", typeof(string));
				DataColumn column3 = new DataColumn("Packet", typeof(string));
				DataColumn column4 = new DataColumn("CreateDate", typeof(DateTime));
				DataColumn column5 = new DataColumn("ProductExpiryDate", typeof(DateTime));
				DataColumn column6 = new DataColumn("subb", typeof(string));
				DataColumn column7 = new DataColumn("ProductNumberOut", typeof(string));
				DataColumn column8 = new DataColumn("ProductNumberBalancer", typeof(string));
				DataColumn column9 = new DataColumn("ProductUnit", typeof(string));
				dataTable.Columns.Add(column);
				dataTable.Columns.Add(column2);
				dataTable.Columns.Add(column3);
				dataTable.Columns.Add(column4);
				dataTable.Columns.Add(column5);
				dataTable.Columns.Add(column6);
				dataTable.Columns.Add(column7);
				dataTable.Columns.Add(column8);
				dataTable.Columns.Add(column9);
				SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
				sqlConnection.Open();
				SqlCommand sqlCommand = sqlConnection.CreateCommand();
				if (sqlQuery == "")
				{
					this.DayBalancer = int.Parse(this.txtDay.Text);
					string text;
					if (this.cbbWareHouse.SelectedValue.ToString() == "0")
					{
						text = "[WID] <> '" + this.cbbWareHouse.SelectedValue.ToString() + "'";
					}
					else
					{
						text = "[WID] = '" + this.cbbWareHouse.SelectedValue.ToString() + "'";
					}
					sqlCommand.CommandText = string.Concat(new string[]
					{
						"SELECT [TabDetailBill].[Pid], [TabDetailBill].[Packet],[TabDetailBill].[ProductName],[TabDetailBill].[ProductNumber],[TabDetailBill].[CreateDate],[TabDetailBill].[ProductExpiryDate],[TabDetailBill].[ProductUnit], DATEDIFF(dy,GETDATE(),[ProductExpiryDate]) AS Subb FROM [TabDetailBill],[TabBill] WHERE ",
						text,
						" AND ([TabDetailBill].[ProductExpiryDate] - getdate() < ",
						this.DayBalancer.ToString(),
						") AND [TabDetailBill].[billID] = [TabBill].[ID] AND [TypeInput] IN ('IN1','IN2') ORDER BY [ProductName]"
					});
				}
				else
				{
					sqlCommand.CommandText = sqlQuery;
				}
				SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
				while (sqlDataReader.Read())
				{
					if (products.getTotalBalancerOfProduct(sqlDataReader["pid"].ToString(), this.cbbWareHouse.SelectedValue.ToString()) > 0f)
					{
						float num = float.Parse(this.numInput(sqlDataReader["Pid"].ToString(), sqlDataReader["Packet"].ToString()));
						float num2 = float.Parse(this.numOutput(sqlDataReader["Pid"].ToString(), sqlDataReader["Packet"].ToString()));
						float num3 = num - num2;
						if (!this.checkProductNameInDataGridView(sqlDataReader["ProductName"].ToString(), sqlDataReader["Packet"].ToString(), dataTable))
						{
							if (!this.checkProductNameInDataGridView(sqlDataReader["ProductName"].ToString(), dataTable))
							{
								dataTable.Rows.Add(new object[]
								{
									sqlDataReader["Pid"].ToString(),
									sqlDataReader["ProductName"].ToString(),
									" " + sqlDataReader["Packet"].ToString(),
									sqlDataReader["CreateDate"].ToString(),
									sqlDataReader["ProductExpiryDate"].ToString().Substring(0, 10),
									sqlDataReader["Subb"].ToString(),
									num2.ToString(),
									num3.ToString(),
									" " + sqlDataReader["ProductUnit"].ToString()
								});
							}
							else
							{
								dataTable.Rows.Add(new object[]
								{
									sqlDataReader["Pid"].ToString(),
									"",
									" " + sqlDataReader["Packet"].ToString(),
									sqlDataReader["CreateDate"].ToString(),
									sqlDataReader["ProductExpiryDate"].ToString().Substring(0, 10),
									sqlDataReader["Subb"].ToString(),
									num2.ToString(),
									num3.ToString(),
									" " + sqlDataReader["ProductUnit"].ToString()
								});
							}
						}
					}
				}
				sqlDataReader.Close();
				sqlConnection.Close();
				sqlConnection.Dispose();
				this.btnPrint.Enabled = true;
				this.objTable = dataTable;
				this.dgvProduct.DataSource = this.objTable;
				if (this.objTable.Rows.Count > 0)
				{
					this.lblWarning.Text = string.Concat(new string[]
					{
						"CÓ ",
						this.dgvProduct.Rows.Count.ToString(),
						" SẢN PHẨM SẼ HẾT HẠN SỬ DỤNG TRONG ",
						this.txtDay.Text.ToUpper(),
						" NGÀY TỚI"
					});
					this.btnPrint.Enabled = true;
				}
				else
				{
					this.lblWarning.Text = "";
					this.btnPrint.Enabled = false;
				}
			}
			catch
			{
				this.btnPrint.Enabled = false;
				this.objTable = null;
				this.dgvProduct.DataSource = this.objTable;
			}
		}
		private bool checkProductNameInDataGridView(string pName, string Packet, DataTable objTable)
		{
			bool result = false;
			for (int i = 0; i < objTable.Rows.Count; i++)
			{
				if (objTable.Rows[i]["ProductName"].ToString().ToUpper() == pName.ToUpper() && objTable.Rows[i]["Packet"].ToString().ToUpper() == Packet.ToUpper())
				{
					result = true;
				}
			}
			return result;
		}
		private bool checkProductNameInDataGridView(string pName, DataTable objTable)
		{
			bool result = false;
			for (int i = 0; i < objTable.Rows.Count; i++)
			{
				if (objTable.Rows[i]["ProductName"].ToString().ToUpper() == pName.ToUpper())
				{
					result = true;
				}
			}
			return result;
		}
		private string numInput(string PID, string Packet)
		{
			string text = "0";
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			sqlConnection.Open();
			SqlCommand sqlCommand = sqlConnection.CreateCommand();
			string text2;
			if (this.cbbWareHouse.SelectedValue.ToString() == "0")
			{
				text2 = "[WID] <> '" + this.cbbWareHouse.SelectedValue.ToString() + "'";
			}
			else
			{
				text2 = "[WID] = '" + this.cbbWareHouse.SelectedValue.ToString() + "'";
			}
			sqlCommand.CommandText = string.Concat(new string[]
			{
				"SELECT ISNULL((SELECT SUM(productNumber) FROM TabDetailBill WHERE BillID IN (SELECT ID FROM TabBill WHERE ",
				text2,
				" AND [TypeInput] IN ('IN1','IN2','IN3')) AND [PID] = ",
				PID,
				" AND packet = '",
				Packet,
				"'),0) AS numberInput"
			});
			SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
			if (sqlDataReader.HasRows)
			{
				while (sqlDataReader.Read())
				{
					text = sqlDataReader["numberInput"].ToString();
				}
			}
			else
			{
				text = "0";
			}
			sqlDataReader.Close();
			sqlConnection.Close();
			sqlConnection.Dispose();
			if (text.Trim() == "")
			{
				text = "0";
			}
			return text;
		}
		private string numOutput(string PID, string Packet)
		{
			string text = "0";
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			sqlConnection.Open();
			SqlCommand sqlCommand = sqlConnection.CreateCommand();
			string text2;
			if (this.cbbWareHouse.SelectedValue.ToString() == "0")
			{
				text2 = "[WID] <> '" + this.cbbWareHouse.SelectedValue.ToString() + "'";
			}
			else
			{
				text2 = "[WID] = '" + this.cbbWareHouse.SelectedValue.ToString() + "'";
			}
			sqlCommand.CommandText = string.Concat(new string[]
			{
				"SELECT ISNULL((SELECT SUM(productNumber/Rate) FROM TabDetailBill WHERE BillID IN (SELECT ID FROM TabBill WHERE ",
				text2,
				" AND [TypeInput] IN ('OUT1','OUT2','OUT3','OUT4')) AND [PID] = ",
				PID,
				" AND packet = '",
				Packet,
				"'),0) - ISNULL((SELECT SUM(productNumber) FROM TabDetailBill WHERE BillID IN (SELECT ID FROM TabBill WHERE ",
				text2,
				" AND [TypeInput] IN ('IN3')) AND [PID] = ",
				PID,
				" AND packet = '",
				Packet,
				"'),0) AS numberOut"
			});
			SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
			if (sqlDataReader.HasRows)
			{
				while (sqlDataReader.Read())
				{
					text = sqlDataReader["numberOut"].ToString();
				}
			}
			else
			{
				text = "0";
			}
			sqlDataReader.Close();
			sqlConnection.Close();
			sqlConnection.Dispose();
			if (text.Trim() == "")
			{
				text = "0";
			}
			return text;
		}
		private void btnSearch_Click(object sender, EventArgs e)
		{
			this.getDetailBalancer("");
		}
		private void resetDataGridView()
		{
			this.objTable = null;
			this.dgvProduct.DataSource = this.objTable;
			this.btnPrint.Enabled = false;
		}
		private void btnPrint_Click(object sender, EventArgs e)
		{
			frmRepExpiryDate.objTable = new DataTable();
			frmRepExpiryDateView frmRepExpiryDateView = new frmRepExpiryDateView();
			frmRepExpiryDate.objTable = this.objTable;
			if (this.cbbParentGID.SelectedValue.ToString() != "0")
			{
				frmRepExpiryDateView.productGroup = "Nhóm hàng hoá : " + this.cbbParentGID.Text;
			}
			else
			{
				frmRepExpiryDateView.productGroup = "Nhóm hàng hoá : Tất cả";
			}
			frmRepExpiryDateView.countItem = this.lblWarning.Text;
			frmRepExpiryDateView.ShowDialog();
		}
		private void cbbDayDefault_CheckedChanged(object sender, EventArgs e)
		{
			if (this.cbbDayDefault.Checked)
			{
				this.txtDay.Enabled = false;
				this.DayBalancer = this.objFunc.getWarningDay();
				this.txtDay.Text = this.DayBalancer.ToString();
			}
			else
			{
				this.txtDay.Enabled = true;
			}
		}
		private void txtSearch_KeyDown(object sender, KeyEventArgs e)
		{
			if (this.txtSearch.Text != "")
			{
				if (e.KeyCode == Keys.Return)
				{
					this.getDetailBalancer(string.Concat(new string[]
					{
						"SELECT [Packet],[Pid],[productName],[productNumberIn],[ProductDate],[ProductExpiryDate],[productNumberOut],[productUnit],[MinBalance],[MaxBalance],[productPrice],[ProductMoney],[NationalID],[VAT], DATEDIFF(dy,GETDATE(),[ProductExpiryDate]) AS Subb FROM [TabTotalBalancer] WHERE ([ProductExpiryDate] - getdate() < ",
						this.DayBalancer.ToString(),
						") AND  [ProductName] LIKE N'%",
						this.txtSearch.Text.ToUpper(),
						"%' ORDER BY [ProductName]"
					}));
				}
			}
		}
		private void btnExportToExcel_Click(object sender, EventArgs e)
		{
			try
			{
				frmRepExpiryDate.objTable = new DataTable();
				frmRepExpiryDate.objTable = this.objTable;
				ActiveReport3 activeReport = new frmRepExpiryDate();
				activeReport.Run();
				XlsExport xlsExport = new XlsExport();
				SaveFileDialog saveFileDialog = new SaveFileDialog();
				saveFileDialog.ShowDialog();
				string text = saveFileDialog.FileName;
				if (text != "")
				{
					if (!text.ToUpper().Contains(".XLS"))
					{
						text += ".xls";
					}
					xlsExport.Export(activeReport.Document, text);
					MessageBox.Show("Hệ thống đã hoàn thành việc xuất dữ liệu ra file Excel", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
				else
				{
					MessageBox.Show("Bạn chưa chọn đường dẫn và tên file cần xuất!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
				}
			}
			catch
			{
			}
		}
		private void cbbWareHouse_SelectedIndexChanged(object sender, EventArgs e)
		{
			this.getDetailBalancer("");
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			DataGridViewCellStyle dataGridViewCellStyle = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle3 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle4 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle5 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle6 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle7 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle8 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle9 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle10 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle11 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle12 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle13 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle14 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle15 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle16 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle17 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle18 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle19 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle20 = new DataGridViewCellStyle();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(frmExpiryDate));
			this.dgvProduct = new DataGridView();
			this.Column2 = new DataGridViewTextBoxColumn();
			this.Column3 = new DataGridViewTextBoxColumn();
			this.Column1 = new DataGridViewTextBoxColumn();
			this.Column7 = new DataGridViewTextBoxColumn();
			this.Column8 = new DataGridViewTextBoxColumn();
			this.Column4 = new DataGridViewTextBoxColumn();
			this.Column5 = new DataGridViewTextBoxColumn();
			this.Column6 = new DataGridViewTextBoxColumn();
			this.Column9 = new DataGridViewTextBoxColumn();
			this.btnClose = new Button();
			this.groupBox1 = new GroupBox();
			this.cbbWareHouse = new ComboBox();
			this.ckbProduct = new System.Windows.Forms.CheckBox();
			this.dgvRep = new DataGridView();
			this.dg2 = new DataGridViewTextBoxColumn();
			this.dg6 = new DataGridViewTextBoxColumn();
			this.label24 = new System.Windows.Forms.Label();
			this.txtSearch = new System.Windows.Forms.TextBox();
			this.label2 = new System.Windows.Forms.Label();
			this.cbbParentGID = new ComboBox();
			this.label1 = new System.Windows.Forms.Label();
			this.cbbDayDefault = new System.Windows.Forms.CheckBox();
			this.txtDay = new System.Windows.Forms.TextBox();
			this.label3 = new System.Windows.Forms.Label();
			this.btnPrint = new Button();
			this.lblWarning = new System.Windows.Forms.Label();
			this.btnExportToExcel = new Button();
			this.label4 = new System.Windows.Forms.Label();
			this.dataGridViewTextBoxColumn1 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn2 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn3 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn4 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn5 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn6 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn7 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn8 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn9 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn10 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn11 = new DataGridViewTextBoxColumn();
			((ISupportInitialize)this.dgvProduct).BeginInit();
			this.groupBox1.SuspendLayout();
			((ISupportInitialize)this.dgvRep).BeginInit();
			base.SuspendLayout();
			this.dgvProduct.AllowUserToAddRows = false;
			this.dgvProduct.AllowUserToDeleteRows = false;
			this.dgvProduct.AllowUserToOrderColumns = true;
			this.dgvProduct.AllowUserToResizeColumns = false;
			this.dgvProduct.AllowUserToResizeRows = false;
			dataGridViewCellStyle.BackColor = Color.FromArgb(192, 255, 255);
			dataGridViewCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle;
			this.dgvProduct.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.dgvProduct.BackgroundColor = Color.White;
			this.dgvProduct.BorderStyle = BorderStyle.Fixed3D;
			this.dgvProduct.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
			this.dgvProduct.Columns.AddRange(new DataGridViewColumn[]
			{
				this.Column2,
				this.Column3,
				this.Column1,
				this.Column7,
				this.Column8,
				this.Column4,
				this.Column5,
				this.Column6,
				this.Column9
			});
			this.dgvProduct.Cursor = Cursors.Hand;
			this.dgvProduct.EnableHeadersVisualStyles = false;
			this.dgvProduct.Location = new System.Drawing.Point(246, 33);
			this.dgvProduct.MultiSelect = false;
			this.dgvProduct.Name = "dgvProduct";
			this.dgvProduct.ReadOnly = true;
			this.dgvProduct.RowHeadersVisible = false;
			this.dgvProduct.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
			dataGridViewCellStyle2.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvProduct.RowsDefaultCellStyle = dataGridViewCellStyle2;
			this.dgvProduct.RowTemplate.DefaultCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvProduct.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
			this.dgvProduct.Size = new Size(647, 524);
			this.dgvProduct.TabIndex = 1;
			this.Column2.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.Column2.DataPropertyName = "productName";
			dataGridViewCellStyle3.Alignment = DataGridViewContentAlignment.MiddleLeft;
			dataGridViewCellStyle3.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle3.ForeColor = Color.Black;
			this.Column2.DefaultCellStyle = dataGridViewCellStyle3;
			this.Column2.HeaderText = "Sản phẩm";
			this.Column2.MinimumWidth = 100;
			this.Column2.Name = "Column2";
			this.Column2.ReadOnly = true;
			this.Column2.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column3.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column3.DataPropertyName = "productUnit";
			this.Column3.HeaderText = "Đơn vị tính";
			this.Column3.MinimumWidth = 120;
			this.Column3.Name = "Column3";
			this.Column3.ReadOnly = true;
			this.Column3.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column3.Width = 120;
			this.Column1.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column1.DataPropertyName = "Packet";
			this.Column1.HeaderText = "Số lô";
			this.Column1.MinimumWidth = 120;
			this.Column1.Name = "Column1";
			this.Column1.ReadOnly = true;
			this.Column1.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column1.Width = 120;
			this.Column7.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column7.DataPropertyName = "CreateDate";
			dataGridViewCellStyle4.Format = "dd/MM/yyyy";
			this.Column7.DefaultCellStyle = dataGridViewCellStyle4;
			this.Column7.HeaderText = "Ngày nhập";
			this.Column7.MinimumWidth = 90;
			this.Column7.Name = "Column7";
			this.Column7.ReadOnly = true;
			this.Column7.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column7.Visible = false;
			this.Column7.Width = 90;
			this.Column8.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column8.DataPropertyName = "ProductExpiryDate";
			dataGridViewCellStyle5.Alignment = DataGridViewContentAlignment.MiddleCenter;
			dataGridViewCellStyle5.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
			dataGridViewCellStyle5.ForeColor = Color.Red;
			dataGridViewCellStyle5.Format = "dd/MM/yyyy";
			this.Column8.DefaultCellStyle = dataGridViewCellStyle5;
			this.Column8.HeaderText = "   Hạn dùng";
			this.Column8.MinimumWidth = 90;
			this.Column8.Name = "Column8";
			this.Column8.ReadOnly = true;
			this.Column8.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column8.Width = 90;
			this.Column4.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column4.DataPropertyName = "Subb";
			dataGridViewCellStyle6.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle6.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
			dataGridViewCellStyle6.ForeColor = Color.Red;
			dataGridViewCellStyle6.Format = "D";
			dataGridViewCellStyle6.NullValue = null;
			this.Column4.DefaultCellStyle = dataGridViewCellStyle6;
			this.Column4.HeaderText = "   Ngày hiệu lực";
			this.Column4.MinimumWidth = 105;
			this.Column4.Name = "Column4";
			this.Column4.ReadOnly = true;
			this.Column4.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column4.Width = 105;
			this.Column5.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column5.DataPropertyName = "ProductNumberOut";
			dataGridViewCellStyle7.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle7.Format = "N0";
			dataGridViewCellStyle7.NullValue = null;
			this.Column5.DefaultCellStyle = dataGridViewCellStyle7;
			this.Column5.HeaderText = "Số lượng xuất";
			this.Column5.MinimumWidth = 120;
			this.Column5.Name = "Column5";
			this.Column5.ReadOnly = true;
			this.Column5.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column5.Visible = false;
			this.Column5.Width = 120;
			this.Column6.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column6.DataPropertyName = "ProductNumberBalancer";
			dataGridViewCellStyle8.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle8.Format = "N0";
			dataGridViewCellStyle8.NullValue = null;
			this.Column6.DefaultCellStyle = dataGridViewCellStyle8;
			this.Column6.HeaderText = "  Số lượng tồn";
			this.Column6.MinimumWidth = 100;
			this.Column6.Name = "Column6";
			this.Column6.ReadOnly = true;
			this.Column6.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column9.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column9.DataPropertyName = "Pid";
			this.Column9.HeaderText = "Mã sản phẩm";
			this.Column9.Name = "Column9";
			this.Column9.ReadOnly = true;
			this.Column9.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column9.Visible = false;
			this.btnClose.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
			this.btnClose.BackColor = SystemColors.ButtonFace;
			this.btnClose.Cursor = Cursors.Hand;
			this.btnClose.FlatAppearance.BorderColor = Color.FromArgb(255, 192, 255);
			this.btnClose.FlatStyle = FlatStyle.Flat;
			this.btnClose.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnClose.Location = new System.Drawing.Point(791, 564);
			this.btnClose.Name = "btnClose";
			this.btnClose.Size = new Size(97, 26);
			this.btnClose.TabIndex = 38;
			this.btnClose.Text = "Thoát  [ ESC ]";
			this.btnClose.UseVisualStyleBackColor = false;
			this.btnClose.Click += new EventHandler(this.btnClose_Click);
			this.groupBox1.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left);
			this.groupBox1.Controls.Add(this.cbbWareHouse);
			this.groupBox1.Controls.Add(this.ckbProduct);
			this.groupBox1.Controls.Add(this.dgvRep);
			this.groupBox1.Controls.Add(this.label24);
			this.groupBox1.Controls.Add(this.txtSearch);
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Controls.Add(this.cbbParentGID);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.groupBox1.Location = new System.Drawing.Point(7, 2);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new Size(233, 592);
			this.groupBox1.TabIndex = 39;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "Điều kiện tìm kiếm";
			this.cbbWareHouse.BackColor = Color.White;
			this.cbbWareHouse.Cursor = Cursors.Hand;
			this.cbbWareHouse.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbWareHouse.FlatStyle = FlatStyle.Flat;
			this.cbbWareHouse.Font = new Font("Arial", 8f, FontStyle.Bold);
			this.cbbWareHouse.FormattingEnabled = true;
			this.cbbWareHouse.Location = new System.Drawing.Point(10, 42);
			this.cbbWareHouse.Name = "cbbWareHouse";
			this.cbbWareHouse.Size = new Size(212, 22);
			this.cbbWareHouse.TabIndex = 92;
			this.cbbWareHouse.SelectedIndexChanged += new EventHandler(this.cbbWareHouse_SelectedIndexChanged);
			this.ckbProduct.BackColor = SystemColors.ControlLight;
			this.ckbProduct.Location = new System.Drawing.Point(10, 183);
			this.ckbProduct.Name = "ckbProduct";
			this.ckbProduct.Size = new Size(212, 21);
			this.ckbProduct.TabIndex = 96;
			this.ckbProduct.Text = "Xem theo sản phẩm";
			this.ckbProduct.UseVisualStyleBackColor = false;
			this.dgvRep.AllowUserToAddRows = false;
			this.dgvRep.AllowUserToDeleteRows = false;
			this.dgvRep.AllowUserToResizeColumns = false;
			this.dgvRep.AllowUserToResizeRows = false;
			dataGridViewCellStyle9.BackColor = Color.FromArgb(192, 255, 255);
			dataGridViewCellStyle9.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.dgvRep.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9;
			this.dgvRep.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left);
			this.dgvRep.BackgroundColor = Color.White;
			this.dgvRep.BorderStyle = BorderStyle.Fixed3D;
			this.dgvRep.CellBorderStyle = DataGridViewCellBorderStyle.Raised;
			this.dgvRep.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.None;
			dataGridViewCellStyle10.BackColor = SystemColors.Control;
			dataGridViewCellStyle10.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			dataGridViewCellStyle10.ForeColor = SystemColors.WindowText;
			dataGridViewCellStyle10.SelectionBackColor = Color.Aqua;
			dataGridViewCellStyle10.SelectionForeColor = Color.Black;
			this.dgvRep.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10;
			this.dgvRep.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
			this.dgvRep.ColumnHeadersVisible = false;
			this.dgvRep.Columns.AddRange(new DataGridViewColumn[]
			{
				this.dg2,
				this.dg6
			});
			this.dgvRep.Cursor = Cursors.Hand;
			this.dgvRep.EnableHeadersVisualStyles = false;
			this.dgvRep.Location = new System.Drawing.Point(10, 204);
			this.dgvRep.MultiSelect = false;
			this.dgvRep.Name = "dgvRep";
			this.dgvRep.ReadOnly = true;
			dataGridViewCellStyle11.BackColor = SystemColors.Control;
			dataGridViewCellStyle11.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			dataGridViewCellStyle11.ForeColor = Color.Black;
			dataGridViewCellStyle11.SelectionBackColor = Color.Aqua;
			dataGridViewCellStyle11.SelectionForeColor = Color.Black;
			this.dgvRep.RowHeadersDefaultCellStyle = dataGridViewCellStyle11;
			this.dgvRep.RowHeadersVisible = false;
			this.dgvRep.RowHeadersWidth = 26;
			this.dgvRep.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
			dataGridViewCellStyle12.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvRep.RowsDefaultCellStyle = dataGridViewCellStyle12;
			this.dgvRep.RowTemplate.DefaultCellStyle.BackColor = Color.White;
			this.dgvRep.RowTemplate.DefaultCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.dgvRep.RowTemplate.DefaultCellStyle.ForeColor = Color.Black;
			this.dgvRep.RowTemplate.DefaultCellStyle.SelectionBackColor = Color.Aqua;
			this.dgvRep.RowTemplate.DefaultCellStyle.SelectionForeColor = Color.Black;
			this.dgvRep.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
			this.dgvRep.Size = new Size(212, 378);
			this.dgvRep.TabIndex = 95;
			this.dg2.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.dg2.DataPropertyName = "P_Name";
			dataGridViewCellStyle13.Alignment = DataGridViewContentAlignment.MiddleLeft;
			dataGridViewCellStyle13.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle13.NullValue = null;
			this.dg2.DefaultCellStyle = dataGridViewCellStyle13;
			this.dg2.HeaderText = "Tên sản phẩm";
			this.dg2.MinimumWidth = 120;
			this.dg2.Name = "dg2";
			this.dg2.ReadOnly = true;
			this.dg6.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dg6.DataPropertyName = "PID";
			this.dg6.HeaderText = "PID";
			this.dg6.Name = "dg6";
			this.dg6.ReadOnly = true;
			this.dg6.Resizable = DataGridViewTriState.False;
			this.dg6.Visible = false;
			this.dg6.Width = 5;
			this.label24.BackColor = SystemColors.ControlLight;
			this.label24.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label24.ForeColor = SystemColors.MenuText;
			this.label24.Location = new System.Drawing.Point(10, 20);
			this.label24.Name = "label24";
			this.label24.Size = new Size(212, 21);
			this.label24.TabIndex = 93;
			this.label24.Text = "Kho hàng";
			this.label24.TextAlign = ContentAlignment.MiddleCenter;
			this.txtSearch.BackColor = Color.White;
			this.txtSearch.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.txtSearch.Location = new System.Drawing.Point(10, 152);
			this.txtSearch.Name = "txtSearch";
			this.txtSearch.Size = new Size(212, 21);
			this.txtSearch.TabIndex = 51;
			this.txtSearch.KeyDown += new KeyEventHandler(this.txtSearch_KeyDown);
			this.label2.BackColor = SystemColors.ControlLight;
			this.label2.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label2.Location = new System.Drawing.Point(10, 130);
			this.label2.Name = "label2";
			this.label2.Size = new Size(212, 21);
			this.label2.TabIndex = 50;
			this.label2.Text = "Sản phẩm";
			this.label2.TextAlign = ContentAlignment.MiddleCenter;
			this.cbbParentGID.BackColor = Color.White;
			this.cbbParentGID.Cursor = Cursors.Hand;
			this.cbbParentGID.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbParentGID.FlatStyle = FlatStyle.Flat;
			this.cbbParentGID.Font = new Font("Arial", 8f);
			this.cbbParentGID.FormattingEnabled = true;
			this.cbbParentGID.Location = new System.Drawing.Point(10, 97);
			this.cbbParentGID.Name = "cbbParentGID";
			this.cbbParentGID.Size = new Size(212, 22);
			this.cbbParentGID.TabIndex = 40;
			this.cbbParentGID.SelectedIndexChanged += new EventHandler(this.cbbParentGID_SelectedIndexChanged);
			this.label1.BackColor = SystemColors.ControlLight;
			this.label1.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label1.Location = new System.Drawing.Point(10, 75);
			this.label1.Name = "label1";
			this.label1.Size = new Size(212, 21);
			this.label1.TabIndex = 41;
			this.label1.Text = "Loại thuốc";
			this.label1.TextAlign = ContentAlignment.MiddleCenter;
			this.cbbDayDefault.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
			this.cbbDayDefault.AutoSize = true;
			this.cbbDayDefault.BackColor = Color.White;
			this.cbbDayDefault.Checked = true;
			this.cbbDayDefault.CheckState = CheckState.Checked;
			this.cbbDayDefault.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.cbbDayDefault.Location = new System.Drawing.Point(609, 11);
			this.cbbDayDefault.Name = "cbbDayDefault";
			this.cbbDayDefault.Size = new Size(125, 19);
			this.cbbDayDefault.TabIndex = 47;
			this.cbbDayDefault.Text = "Báo cáo mặc định";
			this.cbbDayDefault.UseVisualStyleBackColor = false;
			this.cbbDayDefault.CheckedChanged += new EventHandler(this.cbbDayDefault_CheckedChanged);
			this.txtDay.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
			this.txtDay.BackColor = Color.White;
			this.txtDay.Enabled = false;
			this.txtDay.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.txtDay.Location = new System.Drawing.Point(830, 9);
			this.txtDay.Name = "txtDay";
			this.txtDay.Size = new Size(60, 21);
			this.txtDay.TabIndex = 46;
			this.txtDay.Text = "5";
			this.txtDay.TextAlign = HorizontalAlignment.Center;
			this.label3.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
			this.label3.AutoSize = true;
			this.label3.BackColor = Color.White;
			this.label3.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label3.Location = new System.Drawing.Point(736, 12);
			this.label3.Name = "label3";
			this.label3.Size = new Size(90, 15);
			this.label3.TabIndex = 45;
			this.label3.Text = "Ngày hiệu lực :";
			this.label3.TextAlign = ContentAlignment.MiddleRight;
			this.btnPrint.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnPrint.BackColor = SystemColors.ButtonFace;
			this.btnPrint.Cursor = Cursors.Hand;
			this.btnPrint.Enabled = false;
			this.btnPrint.FlatAppearance.BorderColor = Color.FromArgb(255, 192, 255);
			this.btnPrint.FlatStyle = FlatStyle.Flat;
			this.btnPrint.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnPrint.Location = new System.Drawing.Point(251, 564);
			this.btnPrint.Name = "btnPrint";
			this.btnPrint.Size = new Size(102, 26);
			this.btnPrint.TabIndex = 40;
			this.btnPrint.Text = "Xem và in [ F7 ]";
			this.btnPrint.UseVisualStyleBackColor = false;
			this.btnPrint.Click += new EventHandler(this.btnPrint_Click);
			this.lblWarning.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.lblWarning.BackColor = Color.White;
			this.lblWarning.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.lblWarning.ForeColor = Color.Red;
			this.lblWarning.Location = new System.Drawing.Point(246, 7);
			this.lblWarning.Name = "lblWarning";
			this.lblWarning.Size = new Size(646, 25);
			this.lblWarning.TabIndex = 42;
			this.lblWarning.Text = "---";
			this.lblWarning.TextAlign = ContentAlignment.MiddleLeft;
			this.btnExportToExcel.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnExportToExcel.BackColor = SystemColors.ButtonFace;
			this.btnExportToExcel.Enabled = false;
			this.btnExportToExcel.FlatAppearance.BorderColor = Color.FromArgb(255, 192, 255);
			this.btnExportToExcel.FlatStyle = FlatStyle.Flat;
			this.btnExportToExcel.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnExportToExcel.Location = new System.Drawing.Point(357, 564);
			this.btnExportToExcel.Name = "btnExportToExcel";
			this.btnExportToExcel.Size = new Size(102, 26);
			this.btnExportToExcel.TabIndex = 44;
			this.btnExportToExcel.Text = "Xuất file Excel";
			this.btnExportToExcel.UseVisualStyleBackColor = false;
			this.btnExportToExcel.Click += new EventHandler(this.btnExportToExcel_Click);
			this.label4.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.label4.BackColor = Color.White;
			this.label4.Location = new System.Drawing.Point(246, 560);
			this.label4.Name = "label4";
			this.label4.Size = new Size(647, 34);
			this.label4.TabIndex = 97;
			this.dataGridViewTextBoxColumn1.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.dataGridViewTextBoxColumn1.DataPropertyName = "P_Name";
			dataGridViewCellStyle14.Alignment = DataGridViewContentAlignment.MiddleLeft;
			dataGridViewCellStyle14.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle14.NullValue = null;
			this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle14;
			this.dataGridViewTextBoxColumn1.HeaderText = "Tên sản phẩm";
			this.dataGridViewTextBoxColumn1.MinimumWidth = 120;
			this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
			this.dataGridViewTextBoxColumn1.ReadOnly = true;
			this.dataGridViewTextBoxColumn2.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn2.DataPropertyName = "PID";
			this.dataGridViewTextBoxColumn2.HeaderText = "PID";
			this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
			this.dataGridViewTextBoxColumn2.ReadOnly = true;
			this.dataGridViewTextBoxColumn2.Resizable = DataGridViewTriState.False;
			this.dataGridViewTextBoxColumn2.Visible = false;
			this.dataGridViewTextBoxColumn2.Width = 5;
			this.dataGridViewTextBoxColumn3.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.dataGridViewTextBoxColumn3.DataPropertyName = "productName";
			dataGridViewCellStyle15.Alignment = DataGridViewContentAlignment.MiddleLeft;
			dataGridViewCellStyle15.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle15.ForeColor = Color.Black;
			this.dataGridViewTextBoxColumn3.DefaultCellStyle = dataGridViewCellStyle15;
			this.dataGridViewTextBoxColumn3.HeaderText = "Sản phẩm";
			this.dataGridViewTextBoxColumn3.MinimumWidth = 100;
			this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
			this.dataGridViewTextBoxColumn3.ReadOnly = true;
			this.dataGridViewTextBoxColumn3.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn4.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn4.DataPropertyName = "productUnit";
			this.dataGridViewTextBoxColumn4.HeaderText = "Đơn vị tính";
			this.dataGridViewTextBoxColumn4.MinimumWidth = 120;
			this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
			this.dataGridViewTextBoxColumn4.ReadOnly = true;
			this.dataGridViewTextBoxColumn4.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn4.Width = 120;
			this.dataGridViewTextBoxColumn5.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn5.DataPropertyName = "Packet";
			this.dataGridViewTextBoxColumn5.HeaderText = "Số lô";
			this.dataGridViewTextBoxColumn5.MinimumWidth = 120;
			this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
			this.dataGridViewTextBoxColumn5.ReadOnly = true;
			this.dataGridViewTextBoxColumn5.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn5.Width = 120;
			this.dataGridViewTextBoxColumn6.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn6.DataPropertyName = "CreateDate";
			dataGridViewCellStyle16.Format = "dd/MM/yyyy";
			this.dataGridViewTextBoxColumn6.DefaultCellStyle = dataGridViewCellStyle16;
			this.dataGridViewTextBoxColumn6.HeaderText = "Ngày nhập";
			this.dataGridViewTextBoxColumn6.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
			this.dataGridViewTextBoxColumn6.ReadOnly = true;
			this.dataGridViewTextBoxColumn6.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn6.Visible = false;
			this.dataGridViewTextBoxColumn6.Width = 90;
			this.dataGridViewTextBoxColumn7.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn7.DataPropertyName = "ProductExpiryDate";
			dataGridViewCellStyle17.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
			dataGridViewCellStyle17.ForeColor = Color.Red;
			dataGridViewCellStyle17.Format = "dd/MM/yyyy";
			this.dataGridViewTextBoxColumn7.DefaultCellStyle = dataGridViewCellStyle17;
			this.dataGridViewTextBoxColumn7.HeaderText = "   Hạn dùng";
			this.dataGridViewTextBoxColumn7.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
			this.dataGridViewTextBoxColumn7.ReadOnly = true;
			this.dataGridViewTextBoxColumn7.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn7.Width = 90;
			this.dataGridViewTextBoxColumn8.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn8.DataPropertyName = "Subb";
			dataGridViewCellStyle18.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle18.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
			dataGridViewCellStyle18.ForeColor = Color.Red;
			dataGridViewCellStyle18.Format = "D";
			dataGridViewCellStyle18.NullValue = null;
			this.dataGridViewTextBoxColumn8.DefaultCellStyle = dataGridViewCellStyle18;
			this.dataGridViewTextBoxColumn8.HeaderText = "   Ngày hiệu lực";
			this.dataGridViewTextBoxColumn8.MinimumWidth = 105;
			this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
			this.dataGridViewTextBoxColumn8.ReadOnly = true;
			this.dataGridViewTextBoxColumn8.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn8.Width = 105;
			this.dataGridViewTextBoxColumn9.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn9.DataPropertyName = "ProductNumberOut";
			dataGridViewCellStyle19.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle19.Format = "N0";
			dataGridViewCellStyle19.NullValue = null;
			this.dataGridViewTextBoxColumn9.DefaultCellStyle = dataGridViewCellStyle19;
			this.dataGridViewTextBoxColumn9.HeaderText = "Số lượng xuất";
			this.dataGridViewTextBoxColumn9.MinimumWidth = 120;
			this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
			this.dataGridViewTextBoxColumn9.ReadOnly = true;
			this.dataGridViewTextBoxColumn9.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn9.Visible = false;
			this.dataGridViewTextBoxColumn9.Width = 120;
			this.dataGridViewTextBoxColumn10.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn10.DataPropertyName = "ProductNumberBalancer";
			dataGridViewCellStyle20.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle20.Format = "N0";
			dataGridViewCellStyle20.NullValue = null;
			this.dataGridViewTextBoxColumn10.DefaultCellStyle = dataGridViewCellStyle20;
			this.dataGridViewTextBoxColumn10.HeaderText = "  Số lượng tồn";
			this.dataGridViewTextBoxColumn10.MinimumWidth = 100;
			this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10";
			this.dataGridViewTextBoxColumn10.ReadOnly = true;
			this.dataGridViewTextBoxColumn10.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn11.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn11.DataPropertyName = "Pid";
			this.dataGridViewTextBoxColumn11.HeaderText = "Mã sản phẩm";
			this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11";
			this.dataGridViewTextBoxColumn11.ReadOnly = true;
			this.dataGridViewTextBoxColumn11.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn11.Visible = false;
			base.AutoScaleDimensions = new SizeF(7f, 15f);
			//base.AutoScaleMode = AutoScaleMode.Font;
			base.ClientSize = new Size(900, 600);
			base.Controls.Add(this.btnExportToExcel);
			base.Controls.Add(this.btnPrint);
			base.Controls.Add(this.txtDay);
			base.Controls.Add(this.cbbDayDefault);
			base.Controls.Add(this.label3);
			base.Controls.Add(this.btnClose);
			base.Controls.Add(this.dgvProduct);
			base.Controls.Add(this.groupBox1);
			base.Controls.Add(this.label4);
			base.Controls.Add(this.lblWarning);
			this.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			//base.Icon = (System.Drawing.Icon)componentResourceManager.GetObject("$this.Icon");
			//base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon");
			base.KeyPreview = true;
			base.Name = "frmExpiryDate";
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "SẢN PHẨM SẮP HẾT HẠN SỬ DỤNG";
			base.WindowState = FormWindowState.Maximized;
			base.Load += new EventHandler(this.frmInput_Load);
			base.KeyDown += new KeyEventHandler(this.frmInput_KeyDown);
			((ISupportInitialize)this.dgvProduct).EndInit();
			this.groupBox1.ResumeLayout(false);
			this.groupBox1.PerformLayout();
			((ISupportInitialize)this.dgvRep).EndInit();
			base.ResumeLayout(false);
			base.PerformLayout();
		}
	}
}
